﻿//using Sys.Core.Models;
//using Sys.Core.Providers;
//using MiniFox.Infrastructure.Contracts;
//using MiniFox.Web.Mvc.Infrastructure;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using System.Web.Mvc;

//namespace Sys.Controllers
//{
//    [NoCache, ValidationFilter, Area(GlobalConstants.AREA_NAME)]
//    public class NavigationController : AuthorizedController<INavigationProvider>
//    {
//        [HttpGet]
//        public override IActionResult Entry(string name)
//        {
//            if (string.IsNullOrWhiteSpace(name) || string.Equals(name, "index", StringComparison.OrdinalIgnoreCase))
//            {
//                return base.Entry(name, this.Component.GetNavRoot());
//            }
//            return base.Entry(name, null);
//        }
//        [HttpPost]
//        public IActionResult List(QueryObject<NavItem> request)
//        {
//            IEnumerable<NavItem> menuitems = this.Component.GetNavItems(request.Data);
//            Response response = new Response(request);
//            response.Data = menuitems;
//            response.Success = (menuitems != null);
//            return this.ResponseResult(response);
//        }


//        [HttpPost]
//        public IActionResult Create(QueryObject<NavItem> request)
//        {
//            Response<NavItem> response = new Response<NavItem>(request);
//            NavItem menuItem = request.Data;
//            response.Success = Component.CreateNavItem(menuItem);

//            if (response.Success)
//            {
//                response.Data = menuItem;
//                response.Message = "操作成功";
//            }
//            return this.ResponseResult(response);
//        }

//        [HttpPost]
//        public IActionResult Update(QueryObject<NavItem> request)
//        {
//            Response<NavItem> response = new Response<NavItem>(request);
//            NavItem menuItem = request.Data;
//            response.Success = Component.UpdateNavItem(menuItem);

//            if (response.Success)
//            {
//                response.Data = menuItem;
//                response.Message = "操作成功";
//            }
//            return this.ResponseResult(response);
//        }

//        public IActionResult Delete(QueryObject<NavItem> request)
//        {
//            Response response = new Response(request);
//            NavItem menuItem = request.Data;
//            response.Success = this.Component.DeleteNavItem(menuItem);
//            if (response.Success)
//                response.Message = "操作成功";
//            return this.ResponseResult(response);
//        }
//    }
//}
